#include <algorithm>
#include <cstdio>
// 约数和
typedef long long ll;
const int N = 1e7;
int s, k, cnt, pri[N];
bool vis[N];
ll ans[N];

inline bool check(int x) {
  if (x == 1) return 0;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return 0;
  return 1;
}

void dfs(int x, int pcnt, ll Ans) {
  if (x == 1) {
    ans[++cnt] = Ans;
    return;
  }
  ll pk = 1;
  if (check(x - 1) && pri[pcnt] < x) ans[++cnt] = Ans * (x - 1);
  for (int i = pcnt; pri[i] * pri[i] <= x && i <= pri[0]; ++i) {
    pk = pri[i];
    for (ll sum = pri[i] + 1; sum <= x; pk *= pri[i], sum += pk) {
      if (x % sum == 0) dfs(x / sum, i + 1, Ans * pk);
    }
  }
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("P4397 [JLOI2014]聪明的燕姿.in", "r", stdin);
  freopen("P4397 [JLOI2014]聪明的燕姿.out", "w", stdout);
#endif
#endif

  for (int i = 2; i < N; ++i) {
    if (!vis[i]) { pri[++pri[0]] = i; }
    for (int j = 1; j <= pri[0] && i * pri[j] < N; ++j) {
      vis[pri[j] * i] = true;
      if (i % pri[j] == 0) { break; }
    }
  }
  while (scanf("%d", &s) != EOF) {
    cnt = 0;
    dfs(s, 1, 1);
    std::sort(ans + 1, ans + cnt + 1);
    printf("%d\n", cnt);
    for (int i = 1; i <= cnt; ++i) printf("%lld", ans[i]), putchar(" \n"[i == cnt]);
  }
  return 0;
}